package com.zhouyang.bootssh.controller;


import com.zhouyang.bootssh.Utils.ExportExcel;
import com.zhouyang.bootssh.entity.books.User;
import com.zhouyang.bootssh.entity.books.UserExample;
import com.zhouyang.bootssh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Auther: 周洋
 * @Date: 2018/11/8 16:39
 * @Description:
 */

@Controller
@RequestMapping("/poi")
public class PoiTestController {

    @Autowired
    private UserService userService;

    @RequestMapping("/test")
    public String poiTest(HttpServletRequest request, HttpServletResponse response) {
        UserExample example = new UserExample();
        List<User> users = userService.selectByExample(example);
        String[] headers = new String[]{"uid", "username", "password", "name", "email", "telephone", "birthday", "sex", "state", "code"};
        ExportExcel excel = new ExportExcel();
        excel.exportExcel(headers, users, "abc", response);
        return null;
    }

    @RequestMapping("/importFilebyExcel")
    public void importFilebyExcel(){

    }
}
